1. Field of the Invention
The present invention relates to a communication apparatus, a power control method, and a recording medium.
2. Description of the Related Art
Conventionally, there is a demand for reducing power consumption of communication devices used in embedded devices. In response to such a demand, for example, a technique of changing a power mode depending on a type of a packet and a technique of changing a power mode depending on the number of packets stored in a receive buffer have been devised. A technique of changing a power mode depending on a data traffic rate and a technique of calculating a predicted sleep duration using a value output from a protocol timer to change a power mode have also been devised.
It is known that, in TCP (Transmission Control Protocol), which is a communication protocol, a connection/session is established before transmitting and receiving data to perform communication and that a transmission destination sends an ACK (acknowledgement) packet as a response to data communication from a transmission source. It is also known that timers, such as a retransmission timer and a duration timer, are managed and that buffers involved in transmission and reception are managed. In particular, when the communication partner's receive window (buffer) is full, the transmission source suspends transmission until receiving a notice indicating that space becomes available in the receive window.
For example, Japanese Unexamined Patent Application Publication No. 2004-192256 discloses a configuration in which transmission and reception intervals and/or a value output from a protocol timer are utilized to calculate a predicted sleep duration to switch a power mode, in order to reduce power consumption of a communication device.
According to Japanese Unexamined Patent Application Publication No. 2004-192256, the power mode is switched depending on the communication-related data. However, this technique cannot solve a problem that electric power is wasted in a case where data transmission is suspended. More specifically, according to Japanese Unexamined Patent Application Publication No. 2004-192256, as illustrated in FIG. 12, a predicted sleep duration is set on the basis of a response (b) at the time of data transmission (a) from the communication device, and power mode transition is made in accordance with the predicted sleep duration. However, as illustrated in FIG. 13, the communication partner's receive buffer may be full, and an ACK reporting that the receive window size is zero may be returned (c). In this case, although the communication device makes power mode transition in accordance with the predicted sleep duration, the communication partner's receive buffer is full and the communication device cannot transmit data, which results in waste of electric power.
Thus, the power-mode control method of the conventional technique has the following problem that can occur in packet transmission from an embedded system. That is, even though the power mode is changed to a high-power-consumption mode to increase efficiency in packet transmission, the need of suspending transmission or retransmitting a packet can arise depending on capacity of the communication partner and, during the period over which transmission is suspended or the packet is retransmitted, power is consumed uselessly.